
<%@page import="com.surelution.projects.crm.User"%>
<%@ page import="com.surelution.projects.crm.GasType" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:javascript library="jquery" plugin="jquery"/>
        <title><g:message code="default.home.label" /></title>
		<style type="text/css">
			html{height:100%}
			body{height:100%;margin:0px;padding:0px}
			#container{height:100%}
		</style>
    </head>
    <body>
        <div id="controllerList" class="dialog">
	        <g:form action="save">
	        <g:hiddenField name="userId" value="${params.userId }"/>
	        	<table>
	        		<g:each in="${allCategories }" var="cat">
	        			<tr>
	        				<td style="text-align: right;width:100px">${cat.label }:</td>
	        				<td style="text-align: left;">
	        					<g:each in="${cat.children.sort{it.positionSeq} }" var="pageEntry">
		        					<g:if test="${pageEntry.showInMenu }">
		        						<label for="pageEntry_${pageEntry.id}">${pageEntry.label }</label><g:checkBox name="pageEntry" id="pageEntry_${pageEntry.id}" value="${pageEntry.id}" checked="${userPages.any {it.entry.id ==pageEntry.id} }"/>&nbsp;
	        						</g:if>
	        					</g:each>
	        				</td>
	        			</tr>
	        		</g:each>
	        		<tr>
	        			<td colspan="2" style="text-align: right">
	        				<g:submitButton name="save" value="保存"/>
	        				或者，您也可以复制用户<g:select name="copyFrom" from="${com.surelution.projects.crm.User.list() }" optionKey="id" optionValue="username"/>的权限
	        				<g:actionSubmit action="copy" value="复制"/>
	        			</td>
	        		</tr>
	        	</table>
        	</g:form>
        </div>
    </body>
</html>

